stack: Use new snapshot transforms
authorBenjamin Otte <otte@redhat.com>
Thu, 21 Feb 2019 04:34:12 +0000 (05:34 +0100)
committerBenjamin Otte <otte@redhat.com>
Thu, 21 Feb 2019 18:47:28 +0000 (19:47 +0100)
gtk/gtkstack.c

index 94de6d830ba3d62e0e179c3d4cf7968002e8d136..f9a7723448f3cf71c978bb89474b3b25195262eb 100644 (file)
@@ -2095,13 +2095,12 @@ gtk_stack_snapshot_crossfade (GtkWidget   *widget,
 
   if (priv->last_visible_node)
     {
-      gtk_snapshot_offset (snapshot,
-                           priv->last_visible_surface_allocation.x,
-                           priv->last_visible_surface_allocation.y);
+      gtk_snapshot_save (snapshot);
+      gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (
+                              priv->last_visible_surface_allocation.x,
+                              priv->last_visible_surface_allocation.y));
       gtk_snapshot_append_node (snapshot, priv->last_visible_node);
-      gtk_snapshot_offset (snapshot,
-                           -priv->last_visible_surface_allocation.x,
-                           -priv->last_visible_surface_allocation.y);
+      gtk_snapshot_restore (snapshot);
     }
   gtk_snapshot_pop (snapshot);
 
@@ -2163,9 +2162,10 @@ gtk_stack_snapshot_under (GtkWidget   *widget,
 
   if (priv->last_visible_node)
     {
-      gtk_snapshot_offset (snapshot, pos_x, pos_y);
+      gtk_snapshot_save (snapshot);
+      gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (pos_x, pos_y));
       gtk_snapshot_append_node (snapshot, priv->last_visible_node);
-      gtk_snapshot_offset (snapshot, -pos_x, -pos_y);
+      gtk_snapshot_restore (snapshot);
     }
 }
 
@@ -2223,9 +2223,10 @@ gtk_stack_snapshot_slide (GtkWidget   *widget,
             y -= (priv->last_visible_widget_height - height) / 2;
         }
 
-      gtk_snapshot_offset (snapshot, x, y);
+      gtk_snapshot_save (snapshot);
+      gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (x, y));
       gtk_snapshot_append_node (snapshot, priv->last_visible_node);
-      gtk_snapshot_offset (snapshot, -x, -y);
+      gtk_snapshot_restore (snapshot);
      }
 
   gtk_widget_snapshot_child (widget,